package com.yunxi.controller.sto;

import com.yunxi.sto.service.StoStorageMonitorDubboService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Reference;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.core.web.ApiResult;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 库容监控 前端控制器
 * </p>
 *
 * @author caoYong
 * @since 2019-05-22
 */
@RestController
@RequestMapping("/admin/stoStorageMonitor")
@Api(tags = "sto:storageMonitor", description = "库容监控接口")
public class StoStorageMonitorController {
 private static final Logger logger = LoggerFactory.getLogger(StoManageController.class);

 @Autowired
 StoStorageMonitorDubboService stoStorageMonitorDubboService;

 @GetMapping("/list")
 @ApiOperation(value = "获取库区列表")
 public ApiResult list() throws Exception {
  return ResponseUtil.ok(stoStorageMonitorDubboService.list());
 }

 @GetMapping("/detail")
 @ApiOperation(value = "获取库区详情")
 public ApiResult detail(@RequestParam(value = "storageCode")@ApiParam(value = "库区代码",required = true)String storageCode) throws Exception {
  return ResponseUtil.ok(stoStorageMonitorDubboService.detail(storageCode));
 }

}
